package com.ruoyi.applyNews.service.impl;

import java.util.List;

import com.ruoyi.news.domain.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.applyNews.mapper.PassnewsMapper;
import com.ruoyi.applyNews.domain.Passnews;
import com.ruoyi.applyNews.service.IPassnewsService;

/**
 * applyNewsService业务层处理
 * 
 * @author 祁正
 * @date 2023-06-05
 */
@Service
public class PassnewsServiceImpl implements IPassnewsService 
{
    @Autowired
    private PassnewsMapper passnewsMapper;

    @Override
    public int addNews(News news) {
        return passnewsMapper.addNews(news);
    }

    @Override
    public int backNewsApply(int id) {
        return passnewsMapper.backNewsApply(-1,id);
    }

    @Override
    public int passNewsApply(int id) {
        return passnewsMapper.backNewsApply(1,id);
    }

    /**
     * 查询applyNews
     * 
     * @param id applyNews主键
     * @return applyNews
     */
    @Override
    public Passnews selectPassnewsById(Long id)
    {
        return passnewsMapper.selectPassnewsById(id);
    }

    /**
     * 查询applyNews列表
     * 
     * @param passnews applyNews
     * @return applyNews
     */
    @Override
    public List<Passnews> selectPassnewsList(Passnews passnews)
    {
        return passnewsMapper.selectPassnewsList(passnews);
    }

    /**
     * 新增applyNews
     * 
     * @param passnews applyNews
     * @return 结果
     */
    @Override
    public int insertPassnews(Passnews passnews)
    {
        return passnewsMapper.insertPassnews(passnews);
    }

    /**
     * 修改applyNews
     * 
     * @param passnews applyNews
     * @return 结果
     */
    @Override
    public int updatePassnews(Passnews passnews)
    {
        return passnewsMapper.updatePassnews(passnews);
    }

    /**
     * 批量删除applyNews
     * 
     * @param ids 需要删除的applyNews主键
     * @return 结果
     */
    @Override
    public int deletePassnewsByIds(Long[] ids)
    {
        return passnewsMapper.deletePassnewsByIds(ids);
    }

    /**
     * 删除applyNews信息
     * 
     * @param id applyNews主键
     * @return 结果
     */
    @Override
    public int deletePassnewsById(Long id)
    {
        return passnewsMapper.deletePassnewsById(id);
    }
}
